package apiday05.exception;

public class FinallyDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了");

        try {
            String line = "abc";
//            String line = null;
            System.out.println(line.length());
            return;
        } catch (NullPointerException e) {
            System.out.println("出错了");
        } finally {//finally代码必定执行
            System.out.println("finally代码执行了！");
        }
        System.out.println("程序结束了");

    }
}
